package net.zabuchy.activities.entity;

import java.io.Serializable;
import javax.persistence.*;


@Entity
@Table(name="HISTORY_ATTRIBUTE", catalog="quickstart" )
public class HistoryAttribute implements Serializable {
	
	private static final long serialVersionUID = 1L;

	private int attributeId;
	private History_event historyEvent;
	private String name;
	private String value;

	
    public HistoryAttribute() {
    }
    
    public HistoryAttribute(
    		String name,
    		String value,
    		History_event historyEvent) {
    	this.name = name;
    	this.value = value;
    }

    @Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="ATTRIBUTE_ID", nullable=false)
	public int getAttributeId() {
		return this.attributeId;
	}

	public void setAttributeId(int attributeId) {
		this.attributeId = attributeId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "HISTORY_EVENT_ID", nullable = false)
	public History_event getHistoryEvent() {
		return historyEvent;
	}
	
	public void setHistoryEvent(History_event historyEvent) {
		this.historyEvent = historyEvent;
	}

	@Column(name="NAME")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name="VALUE")
	public String getValue() {
		return this.value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
}